package cn.kgc.controller;

import cn.kgc.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author wmm
 * @version 1.0
 * @date 2023/2/23 - 9:50
 */
@RestController//以jspn返回数据
public class HelloWordController {
    @Value("${name}")//将配置文件的内容注入到属性中
    String name;

    @Autowired
    private Person person;


    @RequestMapping("/hello")
    public String hello(){
        return "hello-springboot"+name+person.getName()+"\t"+person.getSex()+"\t"+person.getAge();
    }
}
